var FayeClient = require('faye-request');
var clients = {};
module.exports = function(app) {
  var port = '' + (app.get('port') || 8080);
  var client = clients[port];
  if (!client) {
    client = new FayeClient('http://localhost:' + port + '/faye', {
      timeout: 10
    });
    clients[port] = client;
  }
  return client;
}
